package com.house.keeper.base;

import com.alibaba.fastjson.JSONObject;

/**
 * @author zjj
 * @date 2022-05-13
 */
public class BaseController {
    /**
     * 分页查询响应数据格式
     * @param result
     * @return
     */
    public static JSONObject responseJSONObject(Result result){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("code",result.getResultCode().showCode());
        jsonObject.put("msg",result.getResultCode().showMsg());
        jsonObject.put("data",result.getData());
        jsonObject.put("count",result.getCount());
        return jsonObject;
    }
}
